/// CreateTime 2020/6/29 10:15
/// CreateUser chen 
/// ProjectName flutter_elf
import 'package:flutter_elf/config/component_index.dart';
import 'package:popup_window/popup_window.dart';




const double windowHeight = 200;

class PopWindowPage extends StatefulWidget {
  PopWindowPage({Key key, this.title}) : super(key: key);
  final String title;

  @override
  _PopWindowPageState createState() => _PopWindowPageState();
}

class _PopWindowPageState extends State<PopWindowPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        // Here we take the value from the MyHomePage object that was created by
        // the App.build method, and use it to set our appbar title.
        title: Text(widget.title),
        actions: <Widget>[
          PopupWindowButton(
            offset: Offset(0, windowHeight),
            child: Icon(Icons.cancel,size: 20,),
            window: Container(
              color: Colors.greenAccent,
              height: windowHeight,
            ),
            /// not required.
            builder: (Widget child, Animation<double> animation,
                Animation<double> secondaryAnimation) {
              return FadeTransition(
                opacity: animation,
                child: SizeTransition(
                  sizeFactor: animation,
                  child: child,
                ),
              );
            },
          )
        ],
      ),
      body: Center(
        child: Text(
          'Popup Window Demo, click share icon',
        ),
      ),
    );
  }
}